/**
 * Created by IntelliJ IDEA.
 * User: Bezdelnick
 * Date: 12.09.12
 * Time: 10:16
 * To change this template use File | Settings | File Templates.
 */
package fgui.content {
import fgui.GuiComponent;

import fgui.control.DrawButton;

import fgui.control.ProgressBar;

import flash.events.MouseEvent;
import flash.geom.Point;
import flash.media.Video;

import flash.net.NetConnection;
import flash.net.NetStream;

import mx.controls.Label;

public class VideoContainer extends GuiComponent {
    public var urlVideo:String;
    private var video:Video;
    private var netConnection:NetConnection;
    private var netStream:NetStream;

    // ui
    private var lblTitle:Label;
    private var btnPlayPause:DrawButton;
    private var progress:ProgressBar;

    public function VideoContainer() {
        super(new Point(0, 0), new Point(200, 200));

        //urlVideo = url;

        // ui
        video = new Video();
        addChild(video);
//        btnPlayPause = new DrawButton(new Point(margin, size.y + margin), new Point(30, 30));
//        btnPlayPause.addEventListener(MouseEvent.CLICK, onClickPlayPause);
//        addChild(btnPlayPause);

        netConnection = new NetConnection();
        netConnection.connect(null);
        netStream = new NetStream(netConnection);
        video.attachNetStream(netStream);
    }

    private function onClickPlayPause(event:MouseEvent):void {
        //
    }

    private function playVideo():void {
        netStream.play(urlVideo);
    }

    private function pauseVideo():void {
        //
    }

    private function stopVideo():void {
        //
    }
}
}
